<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace='Indicator' xmlns='http://ibatis.apache.org/mapping' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <alias>
    <typeAlias alias='Indicator' assembly='Janus.Mes.POCO.dll' type='Janus.Mes.POCO.Indicator' />
  </alias>
  <resultMaps>
    <resultMap id='IndicatorResult' class='Indicator'>
	<result property='Id' column='Id' /> 
	<result property='IndicatorName' column='IndicatorName' /> 
	<result property='IndicatorFiledName' column='IndicatorFiledName' /> 
	<result property='IndicatorValue' column='IndicatorValue' /> 
	<result property='CreateDt' column='CreateDt' /> 
	<result property='IntNull' column='IntNull' /> 
	<result property='IntNotNull' column='IntNotNull' /> 
	<result property='Bit' column='Bit' /> 
	<result property='CreateDate' column='CreateDate' /> 
	<result property='Creator' column='Creator' /> 
	<result property='CreatorCode' column='CreatorCode' /> 
	<result property='UpdateDate' column='UpdateDate' /> 
	<result property='Updater' column='Updater' /> 
	<result property='UpdaterCode' column='UpdaterCode' /> 
	<result property='DepCode' column='DepCode' /> 
		</resultMap>
  </resultMaps>  
  <statements>
  <sql id="UpdaterConditions">  
  <dynamic prepend="SET">
      	<isPropertyAvailable prepend="" property="IndicatorName">
        <isNotEmpty prepend="," property="IndicatorName">
		          [IndicatorName]=#IndicatorName#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="IndicatorFiledName">
        <isNotEmpty prepend="," property="IndicatorFiledName">
		          [IndicatorFiledName]=#IndicatorFiledName#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="IndicatorValue">
        <isNotEmpty prepend="," property="IndicatorValue">
		          [IndicatorValue]=#IndicatorValue#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreateDt">
        <isNotEmpty prepend="," property="CreateDt">
		          [CreateDt]=#CreateDt#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="IntNull">
        <isNotEmpty prepend="" property="IntNull">
				  <isNotEqual prepend="," property="IntNull" compareValue="0">
		          [IntNull]=#IntNull#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="IntNotNull">
        <isNotEmpty prepend="," property="IntNotNull">
		          [IntNotNull]=#IntNotNull#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Bit">
        <isNotEmpty prepend="," property="Bit">
		          [Bit]=#Bit#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="" property="CreateDate">
				  <isNotEqual prepend="," property="CreateDate" compareValue="1900-01-01">
		          [CreateDate]=#CreateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">
		          [Creator]=#Creator#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">
		          [CreatorCode]=#CreatorCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="" property="UpdateDate">
				  <isNotEqual prepend="," property="UpdateDate" compareValue="1900-01-01">
		          [UpdateDate]=#UpdateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">
		          [Updater]=#Updater#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">
		          [UpdaterCode]=#UpdaterCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="DepCode">
        <isNotEmpty prepend="," property="DepCode">
		          [DepCode]=#DepCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	  	 </dynamic>
    </sql>
	<sql id="WhereConditions">
	 <dynamic prepend="WHERE">
	 	 <isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="AND" property="Id">
		          [Id]=#Id#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IndicatorName">
        <isNotEmpty prepend="AND" property="IndicatorName">
		          [IndicatorName]=#IndicatorName#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IndicatorFiledName">
        <isNotEmpty prepend="AND" property="IndicatorFiledName">
		          [IndicatorFiledName]=#IndicatorFiledName#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IndicatorValue">
        <isNotEmpty prepend="AND" property="IndicatorValue">
		          [IndicatorValue]=#IndicatorValue#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreateDt">
        <isNotEmpty prepend="AND" property="CreateDt">
		          [CreateDt]=#CreateDt#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IntNull">
        <isNotEmpty prepend="" property="IntNull">
				  <isNotEqual prepend="AND" property="IntNull" compareValue="0">
		          [IntNull]=#IntNull#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IntNotNull">
        <isNotEmpty prepend="AND" property="IntNotNull">
		          [IntNotNull]=#IntNotNull#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Bit">
        <isNotEmpty prepend="AND" property="Bit">
		          [Bit]=#Bit#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="" property="CreateDate">
				  <isNotEqual prepend="AND" property="CreateDate" compareValue="1900-01-01">
		          [CreateDate]=#CreateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="AND" property="Creator">
		          [Creator]=#Creator#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="AND" property="CreatorCode">
		          [CreatorCode]=#CreatorCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="" property="UpdateDate">
				  <isNotEqual prepend="AND" property="UpdateDate" compareValue="1900-01-01">
		          [UpdateDate]=#UpdateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="AND" property="Updater">
		          [Updater]=#Updater#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="AND" property="UpdaterCode">
		          [UpdaterCode]=#UpdaterCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="DepCode">
        <isNotEmpty prepend="AND" property="DepCode">
		          [DepCode]=#DepCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic> 
    </sql>
	<sql id="InsertPublic">
      INSERT INTO Indicator(
	     <dynamic prepend=" ">
       	   <isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="," property="Id">
          [Id]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IndicatorName">
        <isNotEmpty prepend="," property="IndicatorName">
          [IndicatorName]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IndicatorFiledName">
        <isNotEmpty prepend="," property="IndicatorFiledName">
          [IndicatorFiledName]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IndicatorValue">
        <isNotEmpty prepend="," property="IndicatorValue">
          [IndicatorValue]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreateDt">
        <isNotEmpty prepend="," property="CreateDt">
          [CreateDt]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IntNull">
        <isNotEmpty prepend="," property="IntNull">
          [IntNull]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IntNotNull">
        <isNotEmpty prepend="," property="IntNotNull">
          [IntNotNull]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Bit">
        <isNotEmpty prepend="," property="Bit">
          [Bit]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="," property="CreateDate">
          [CreateDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">
          [Creator]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">
          [CreatorCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="," property="UpdateDate">
          [UpdateDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">
          [Updater]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">
          [UpdaterCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="DepCode">
        <isNotEmpty prepend="," property="DepCode">
          [DepCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic>
      )
      VALUES
      (
	   <dynamic prepend=" ">
      	<isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="," property="Id">		
         #Id#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IndicatorName">
        <isNotEmpty prepend="," property="IndicatorName">		
         #IndicatorName#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IndicatorFiledName">
        <isNotEmpty prepend="," property="IndicatorFiledName">		
         #IndicatorFiledName#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IndicatorValue">
        <isNotEmpty prepend="," property="IndicatorValue">		
         #IndicatorValue#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreateDt">
        <isNotEmpty prepend="," property="CreateDt">		
         #CreateDt#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IntNull">
        <isNotEmpty prepend="," property="IntNull">		
         #IntNull#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IntNotNull">
        <isNotEmpty prepend="," property="IntNotNull">		
         #IntNotNull#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Bit">
        <isNotEmpty prepend="," property="Bit">		
         #Bit#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="," property="CreateDate">		
         #CreateDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">		
         #Creator#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">		
         #CreatorCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="," property="UpdateDate">		
         #UpdateDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">		
         #Updater#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">		
         #UpdaterCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="DepCode">
        <isNotEmpty prepend="," property="DepCode">		
         #DepCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic>
      )
    </sql>
	<!-- Insert statement:新增Mapper-->
    <insert id='Insert' parameterClass='Indicator'>
      <include refid="InsertPublic"/>
    </insert>
    <!--Update statement:修改Mapper-->
    <update id='Update' parameterClass='Indicator'>
      UPDATE [Indicator] 
      <include refid="UpdaterConditions"/>
      WHERE 1=1
	  	  AND Id=#Id#
	      </update>
    <update id='UpdateSetion' parameterClass='hashtable'>
      UPDATE [Indicator] 
      <include refid="UpdaterConditions"/>
      WHERE $conditions$
    </update>
	<update id='Save' parameterClass='Indicator'>
      IF NOT EXISTS(SELECT 1 FROM [Indicator] WHERE 1=1  AND [Id]=#Id# )
      BEGIN
      <include refid="InsertPublic"/>
      END
      ELSE
      BEGIN
      UPDATE Indicator 
      <include refid="UpdaterConditions"/>
      WHERE  1=1
	  	  AND [Id]=#Id#
	        END
    </update>
	<delete id='Delete' parameterClass='hashtable'>
      DELETE FROM [Indicator] WHERE	  
        <![CDATA[  
	 [Id]=#pk0# 
        ]]>
    </delete>
    <delete id='DeleteWhere' parameterClass='string'>
      DELETE FROM [Indicator] WHERE $value$
    </delete>

    <!-- select by key statement:-->
    <select id='FindOne' parameterClass='hashtable' resultClass='Indicator'>
      SELECT * FROM Indicator WHERE      
        <![CDATA[
		[Id]=#pk0# 
        ]]>
    </select>
    <select id='FindAllCondition' parameterClass='string' resultClass='Indicator'>
      SELECT * FROM [Indicator] WHERE $value$
    </select>
    <select id='FindScalar' parameterClass='hashtable' resultClass='Indicator'>
      SELECT * FROM [Indicator] WHERE $conditions$
    </select>
    
    <select id='FindAllCount' parameterClass='string' resultClass='int'>
      SELECT COUNT(1) FROM [Indicator] WHERE $value$
    </select>
    <select id='FindByPage' parameterClass='string' resultClass='Indicator'>
      SELECT * FROM [Indicator] WHERE $value$
    </select>
  </statements>
</sqlMap>
